The return value of g_getenv() isn't freeable, so g_strdup it.
authorRobert Brady <robert@suse.co.uk>
Wed, 15 Nov 2000 02:45:55 +0000 (02:45 +0000)
committerRobert Brady <rbrady@src.gnome.org>
Wed, 15 Nov 2000 02:45:55 +0000 (02:45 +0000)
Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>

* gtk/gtkrc.c (gtk_rc_get_im_module_file): The return
value of g_getenv() isn't freeable, so g_strdup it.

* modules/input/inuktitut.c: Inuktitut input method.

* modules/input/Makefile.am: Build this.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkrc.c
modules/input/Makefile.am
modules/input/iminuktitut.c [new file with mode: 0644]

index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index 0ef8f2edb60b86b4e77da831bdfe0e92316add24..30b8a5afdf17857fdda9260df805417eb29eaf15 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 15 02:18:01 2000  Robert Brady  <robert@suse.co.uk>
+
+       * gtk/gtkrc.c (gtk_rc_get_im_module_file): The return 
+       value of g_getenv() isn't freeable, so g_strdup it.
+
+       * modules/input/inuktitut.c: Inuktitut input method.
+
+       * modules/input/Makefile.am: Build this.
+       
 2000-11-14  Elliot Lee  <sopwith@redhat.com>
 
        * gtk/Makefile.am: Install gtk.immodules, needed for operation
index a70ac9b991cc2b5c161b6781dac36beb9615dcb7..65c5bc3c30ae7e699d672c521929a65180f6d68c 100644 (file)
@@ -348,7 +348,7 @@ gtk_rc_get_im_module_path (void)
 gchar *
 gtk_rc_get_im_module_file (void)
 {
-  gchar *result = g_getenv ("GTK_IM_MODULE_FILE");
+  gchar *result = g_strdup (g_getenv ("GTK_IM_MODULE_FILE"));
 
   if (!result)
     {
index c05492d7f926aa8c1ef347b6ace36d83c2ffbb24..f803cba60790408b17250e89d77b1a383d0ea0af 100644 (file)
@@ -33,7 +33,8 @@ LDADDS = @STRIP_BEGIN@                                        \
 @STRIP_END@
 
 moduledir = $(libdir)/gtk-2.0/$(GTK_VERSION)/immodules
-module_LTLIBRARIES = im-cyrillic-translit.la im-xim.la im-viqr.la im-thai-broken.la
+module_LTLIBRARIES = im-cyrillic-translit.la im-xim.la im-viqr.la im-thai-broken.la \
+                     im-inuktitut.la
 
 im_cyrillic_translit_la_LDFLAGS = -rpath $(libdir) -avoid-version -module
 im_cyrillic_translit_la_SOURCES = imcyrillic-translit.c
@@ -44,6 +45,9 @@ im_thai_broken_la_SOURCES = imthai-broken.c
 im_viqr_la_LDFLAGS = -rpath $(libdir) -avoid-version -module
 im_viqr_la_SOURCES = imviqr.c
 
+im_inuktitut_la_LDFLAGS = -rpath $(libdir) -export-dynamic -avoid-version -module
+im_inuktitut_la_SOURCES = iminuktitut.c
+
 im_xim_la_LDFLAGS = -rpath $(libdir) -avoid-version -module
 im_xim_la_SOURCES =            \
        gtkimcontextxim.c       \
diff --git a/modules/input/iminuktitut.c b/modules/input/iminuktitut.c
new file mode 100644 (file)
index 0000000..066875e
--- /dev/null
@@ -0,0 +1,162 @@
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2000 Red Hat Software
+ * Copyright (C) 2000 SuSE Linux Ltd
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Original author: Owen Taylor <otaylor@redhat.com>
+ * 
+ * Modified for Inuktitut - Robert Brady <robert@suse.co.uk>
+ *
+ */
+
+#include <string.h>
+
+#include <gdk/gdkkeysyms.h>
+
+#include "gtk/gtkintl.h"
+#include "gtk/gtkimcontextsimple.h"
+#include "gtk/gtkimmodule.h"
+
+GType type_inuktitut_translit = 0;
+
+static void inuktitut_class_init (GtkIMContextSimpleClass *class);
+static void inuktitut_init (GtkIMContextSimple *im_context);
+
+static void
+inuktitut_register_type (GTypeModule *module)
+{
+  static const GTypeInfo object_info =
+  {
+    sizeof (GtkIMContextSimpleClass),
+    (GBaseInitFunc) NULL,
+    (GBaseFinalizeFunc) NULL,
+    (GClassInitFunc) inuktitut_class_init,
+    NULL,           /* class_finalize */
+    NULL,           /* class_data */
+    sizeof (GtkIMContextSimple),
+    0,
+    (GtkObjectInitFunc) inuktitut_init,
+  };
+
+  type_inuktitut_translit = 
+    g_type_module_register_type (module,
+                                GTK_TYPE_IM_CONTEXT_SIMPLE,
+                                "GtkIMContextInukitut",
+                                &object_info, 0);
+}
+
+#define SYL(a,b,c,d) \
+  a, 0,   0, 0, 0, c, \
+  a, 'a', 0, 0, 0, b+7-d, \
+  a, 'a','a',0, 0, b+8-d, \
+  a, 'i', 0, 0, 0, b, \
+  a, 'i','i',0, 0, b+1, \
+  a, 'o', 0, 0, 0, b+2, \
+  a, 'o','o',0, 0, b+3, \
+  a, 'u', 0, 0, 0, b+2, \
+  a, 'u','u',0, 0, b+3,
+
+static guint16 inuktitut_compose_seqs[] = {
+  'a', 0,   0,   0 ,  0,   0x140a,
+  'a', 'a', 0,   0,   0,   0x140b,
+
+  SYL('c', 0x148b, 0x14a1, 2) /* As g */
+  SYL('f', 0x1555, 0x155d, 2)
+  SYL('g', 0x148b, 0x14a1, 2)
+  SYL('h', 0x14ef, 0x1505, 2)
+
+  'i', 0,   0,   0 ,  0,   0x1403,
+  'i', 'i', 0,   0,   0,   0x1404,
+
+  SYL('j', 0x1528, 0x153e, 2)
+  SYL('k', 0x146d, 0x1483, 2)
+  SYL('l', 0x14d5, 0x14ea, 2)
+  SYL('m', 0x14a5, 0x14bb, 2)
+  SYL('n', 0x14c2, 0x14d0, 2)
+  SYL('p', 0x1431, 0x1449, 0)
+
+  'o', 0,   0,   0 ,  0,   0x1405, /* as u */
+  'o', 'o', 0,   0,   0,   0x1406,
+
+  SYL('q', 0x157f, 0x1585, 3)
+  SYL('r', 0x1546, 0x1550, 2)
+  SYL('s', 0x14ef, 0x1505, 2) /* As h */
+  SYL('t', 0x144e, 0x1466, 0)
+
+  'u', 0,   0,   0 ,  0,   0x1405,
+  'u', 'u', 0,   0,   0,   0x1406,
+
+  SYL('v', 0x1555, 0x155d, 2) /* as f */
+  SYL('y', 0x1528, 0x153e, 2) /* As j */
+
+  SYL(GDK_lstroke, 0x15a0, 0x15a6, 3) /* l- */
+  SYL(GDK_eng, 0x158f, 0x1595, 3)     /* ng */
+};
+
+static void
+inuktitut_class_init (GtkIMContextSimpleClass *class)
+{
+}
+
+static void
+inuktitut_init (GtkIMContextSimple *im_context)
+{
+  gtk_im_context_simple_add_table (im_context,
+                                  inuktitut_compose_seqs,
+                                  4,
+                                  G_N_ELEMENTS (inuktitut_compose_seqs) / (4 + 2));
+}
+
+static const GtkIMContextInfo inuktitut_info = { 
+  "inuktitut",            /* ID */
+  N_("Inukitut (Transliterated)"),         /* Human readable name */
+  "gtk+",                 /* Translation domain */
+   GTK_LOCALEDIR,         /* Dir for bindtextdomain (not strictly needed for "gtk+") */
+  "iu"                    /* Languages for which this module is the default */
+};
+
+static const GtkIMContextInfo *info_list[] = {
+  &inuktitut_info
+};
+
+void
+im_module_init (GTypeModule *module)
+{
+  inuktitut_register_type (module);
+}
+
+void 
+im_module_exit (void)
+{
+}
+
+void 
+im_module_list (const GtkIMContextInfo ***contexts,
+               int                      *n_contexts)
+{
+  *contexts = info_list;
+  *n_contexts = G_N_ELEMENTS (info_list);
+}
+
+GtkIMContext *
+im_module_create (const gchar *context_id)
+{
+  if (strcmp (context_id, "inuktitut") == 0)
+    return GTK_IM_CONTEXT (gtk_type_new (type_inuktitut_translit));
+  else
+    return NULL;
+}